package com.fand.dto;

import java.util.List;

/**
 * 分页
 * 
 * @author yaoHT
 * @param <T>
 *            泛型
 */
public class PaginationDto<T> implements java.io.Serializable {
	/**
	 * 版本号
	 */
	private static final long serialVersionUID = 2759596825937626448L;
	
	/**
	 * 开始行数
	 */
	private int beginRowNum;
	
	/**
	 * 数据集合
	 */
	private List<T> dataList;
	
	/**
	 * 结束行数
	 */
	private int endRowNum;
	
	private int firstNo;
	
	private boolean hasFirstNo;
	
	private boolean hasLastNo;
	
	private boolean hasNextNo = false;// 是否有下一页
	
	private boolean hasPreviousNo = false;// 是否有前一页
	
	private int lastNo;
	
	private int nextNo = 2;// 下一页
	
	/**
	 * 分页号
	 */
	private int no;
	
	/**
	 * 分页号集合
	 */
	private int[] nos;
	
	private int previousNo = 1;// 上一页
	
	/**
	 * 分页大小
	 */
	private int size;
	
	/**
	 * 统计分页号
	 */
	private int totalNo;
	
	/**
	 * 统计大小
	 */
	private int totalSize;
	
	public int getBeginRowNum() {
		return this.beginRowNum;
	}
	
	/**
	 * 获取
	 * 
	 * @return 数据集合
	 */
	public List<T> getDataList() {
		return this.dataList;
	}
	
	public int getEndRowNum() {
		return this.endRowNum;
	}
	
	public int getFirstNo() {
		return this.firstNo;
	}
	
	public int getLastNo() {
		return this.lastNo;
	}
	
	public int getNextNo() {
		return this.nextNo;
	}
	
	public int getNo() {
		return this.no;
	}
	
	public int[] getNos() {
		return this.nos;
	}
	
	public int getPreviousNo() {
		return this.previousNo;
	}
	
	public int getSize() {
		return this.size;
	}
	
	public int getTotalNo() {
		return this.totalNo;
	}
	
	/**
	 * 获取
	 * 
	 * @return 统计大小
	 */
	public int getTotalSize() {
		return this.totalSize;
	}
	
	public boolean isHasFirstNo() {
		return this.hasFirstNo;
	}
	
	public boolean isHasLastNo() {
		return this.hasLastNo;
	}
	
	public boolean isHasNextNo() {
		return this.hasNextNo;
	}
	
	public boolean isHasPreviousNo() {
		return this.hasPreviousNo;
	}
	
	public PaginationDto<T> setBeginRowNum(final int beginRowNum) {
		this.beginRowNum = beginRowNum;
		
		return this;
	}
	
	/**
	 * 设置
	 * 
	 * @param dataList
	 *            数据集合
	 */
	public PaginationDto<T> setDataList(final List<T> dataList) {
		this.dataList = dataList;
		
		return this;
	}
	
	public PaginationDto<T> setEndRowNum(final int endRowNum) {
		this.endRowNum = endRowNum;
		
		return this;
	}
	
	public PaginationDto<T> setFirstNo(final int firstNo) {
		this.firstNo = firstNo;
		
		return this;
	}
	
	public PaginationDto<T> setHasFirstNo(final boolean hasFirstNo) {
		this.hasFirstNo = hasFirstNo;
		
		return this;
	}
	
	public PaginationDto<T> setHasLastNo(final boolean hasLastNo) {
		this.hasLastNo = hasLastNo;
		
		return this;
	}
	
	public PaginationDto<T> setHasNextNo(final boolean hasNextNo) {
		this.hasNextNo = hasNextNo;
		
		return this;
	}
	
	public PaginationDto<T> setHasPreviousNo(final boolean hasPreviousNo) {
		this.hasPreviousNo = hasPreviousNo;
		
		return this;
	}
	
	public PaginationDto<T> setLastNo(final int lastNo) {
		this.lastNo = lastNo;
		
		return this;
	}
	
	public PaginationDto<T> setNextNo(final int nextNo) {
		this.nextNo = nextNo;
		
		return this;
	}
	
	public PaginationDto<T> setNo(final int no) {
		this.no = no;
		
		return this;
	}
	
	public PaginationDto<T> setNos(final int[] nos) {
		this.nos = nos;
		
		return this;
	}
	
	public PaginationDto<T> setPreviousNo(final int previousNo) {
		this.previousNo = previousNo;
		
		return this;
	}
	
	public PaginationDto<T> setSize(final int size) {
		this.size = size;
		
		return this;
	}
	
	public PaginationDto<T> setTotalNo(final int totalNo) {
		this.totalNo = totalNo;
		
		return this;
	}
	
	/**
	 * 设置
	 * 
	 * @param totalSize
	 *            统计大小
	 */
	public PaginationDto<T> setTotalSize(final int totalSize) {
		this.totalSize = totalSize;
		
		return this;
	}
}
